/**
 * Created by zhaojing on 2017/1/20.
 */

import Vue from 'vue';
import VueI18n from 'vue-i18n';

import './base/init';

import MyAssets from '../component/MyAssets.vue';
import Loading from '../../grsc-base/component/Loading.vue';
import Popover from '../../grsc-base/component/Popover.vue';
import LangPopover from '../component/LangPopover.vue';
import Index from '../module/index/main';
import messages from '../module/index/lang';

Vue.use(VueI18n);

let i18n =  new VueI18n({
    locale: window.app.LANG,
    messages, // set locale messages
});

const app = new Vue({
    i18n,
    components: {
        Index,
        Loading,
        MyAssets,
        LangPopover,
        Popover
    },
    methods: {
        // getPresend(isLogin) {
        //     console.log(window.location)
        //     if(isLogin){
        //         window.location.href = '';
        //         console.log('登陆了');
        //     }else{
        //         window.error('请登陆后，再领取，3秒后为您跳转登陆');
        //         setTimeout(()=>{
        //             let fromPath = window.encodeURIComponent(window.location.href.replace('index.html','get-presend.html'));
        //             window.location.href = './login.html?from=' + fromPath;
        //         },3000)
        //         console.log('没登陆');
        //     }
            
        // }
    }
}).$mount('#app');
